home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Modules
/
BackSpaceModules
/
Source
/
SchoolView
/
SchoolView.h
< prev
next >
Wrap
Text File
|
1994-04-17
|
2KB
|
87 lines
/**********************************************************************
SchoolView.h
Author: David C. "Slam" Lambert
Date: 1 February, 1993
**********************************************************************/
#import <appkit/View.h>
struct boid {
float x;
float y;
float xVel;
float yVel;
float xAcc;
float yAcc;
};
typedef struct boid BOID;
#define BOID_X(b) ((b)->x)
#define BOID_Y(b) ((b)->y)
#define BOID_XVEL(b) ((b)->xVel)
#define BOID_YVEL(b) ((b)->yVel)
#define BOID_XACC(b) ((b)->xAcc)
#define BOID_YACC(b) ((b)->yAcc)
#define ABS(x) ((x>0.0)?x:-x)
#define XDIFF(b0, b1) ((b0->x) - (b1->x))
#define YDIFF(b0, b1) ((b0->y) - (b1->y))
#define NORM(q1, q2) (sqrt(q1*q1 + q2*q2))
#define MIN_DIST (0.5)
@interface SchoolView:View
{
int schoolCount;
int goalChgFreq;
BOOL hasColor;
BOOL followMouse;
float maxVel;
float minVel;
float distExp;
float accLimit;
float avoidFact;
float matchFact;
float targetFact;
float minRadius;
float centerFact;
float momentum;
float distComp;
char *schoolString;
char *oldString;
float *coords;
float *oldCoords;
NXPoint goalPoint;
BOID *theSchools;
NXColor theBackColor;
id theFont;
id thePanel;
id countField;
id countSlider;
id vMaxField;
id vMaxSlider;
id avoidField;
id avoidSlider;
id followSwitch;
id targetImage;
}
+ initialize;
- initFrame:(const NXRect *)theFrame;
- free;
- setup;
- oneStep;
- setValues;
- didLockFocus;
- awakeFromNib;
- writeDefaults;
- inspector:sender;
- takeValues:sender;
- computeAccelerations;
- (BOOL)useBufferedWindow;
- (BOOL)ignoreMouseMovement;
- sizeTo:(NXCoord)w :(NXCoord)h;
- drawSelf:(const NXRect *)theRects :(int)rectCount;
@end